<?
$sqlWhere = '';
$sqlWhere .= ' AND pro_active = 1 ';
$db_listing	= new db_query("SELECT *
				FROM (categories_multi, products_multi) INNER JOIN product_hits ON pro_id = ph_id
				WHERE cat_id = pro_category_id AND categories_multi.lang_id = " . $lang_id . $sqlWhere . "
				ORDER BY pro_new DESC, pro_date DESC LIMIT 5");
$count = mysql_num_rows($db_listing->result);
if ($count > 0)
{
?>
<div class="module_small module_small_menu_product">
	<div class="title">
    	<div class="fl left_icon"></div>
        <div class="fl"><span lang="<?=$array_lang[$lang_id][0];?>"><?=tdt('San_pham_moi')?></span></div>
        <div class="fr right_icon"></div>
	</div>
    <div class="content menu_product module_larger padding_home">
    	
        <?
		$i = 0;
        while ($listing = mysql_fetch_array($db_listing->result))
        {
                ++$i;
                $class = ($i==$count)?'end':'normal';
                $detail_url = generate_detail_url('product',$listing['cat_id'],$listing['pro_id'],$listing['pro_name']);
                ?>
                
                <div class="normal">
                    <div class="news_pictures">
                        <span><a title="<?=$listing['pro_name']?>" href="<?=$detail_url?>" style="background-image:url(/products_pictures/small_<?=$listing['pro_picture']?>);height: 60px;width: 60px;"></a></span>
                    </div>
                    <div class="news_title" style="margin-bottom: 3px;">
                        <a href="<?=$detail_url?>"><?=  cut_string($listing['pro_name'], 150)?></a>
                    </div>
                    <div class="news_teaser text_normal">
                        <div class="product_price" style="margin-bottom: 0px;">
                            <font lang="<?=$listing['lang_id']?>"><?=tdt('Gia')?></font>: <span class="price"><? if ($listing['pro_price'] > 0) { echo format_number($listing['pro_price']) . ' VNĐ';} else { if ($con_message_zero_price == '') { echo tdt('Vui_long_goi');} else { echo $con_message_zero_price;}}?></span>
                        </div>
                        <div>
                            <span class="product_last_update"><font lang="<?=$listing['lang_id']?>"><?=tdt('Update')?></font>: <span><?=date('d/m/Y', $listing['pro_date'])?></span></span>
                        </div>
                    </div>
                </div>
                <div class="break_module_line" style="background: url('/images/lv01_bottom_bg.gif') no-repeat scroll center center transparent"></div>
                <?
        }
        ?>
       
    </div>
</div>
<div class="module_bottom_small module_bottom_menu_product"><div class="fl"></div><div class="fr"></div></div>
<?
}
unset($db_listing);
?>